/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.webservice.pa;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author OANHHUYNH
 */
public class ConnectionClass {
 public static Connection getConnectionDB(){
        Connection cn = null;
        try {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            String url = "jdbc:sqlserver://OANHHUYNH-PC;databaseName=WineshopDB;" + "user=sa;password = 123";
            cn = DriverManager.getConnection(url);

        } catch (SQLException ex) {
            Logger.getLogger(ConnectionClass.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(ConnectionClass.class.getName()).log(Level.SEVERE, null, ex);
        }
        return cn;
    }
}
